<template>
  <div>
    <advice
      v-for="item in props.adviceItem"
      :key="item.id"
      :advice="item.content"
      :username="item.realname"
      :id="item.id"
      :time="item.time"
      :realname="item.username"
      @click="showAdviceContent"
    ></advice>
    <seeAdvice ref="writeAdvice"></seeAdvice>
  </div>
</template>

<script setup lang="ts">
import advice from "../../../components/advice.vue";
import seeAdvice from "../../advice/seeAdvice.vue";
import { adviceType } from "@/type/advice";
import { defineProps } from "vue";
const props = defineProps({
  adviceItem: {
    type: Array as () => Array<adviceType>,
    default: () => [],
  },
});

const showAdviceContent = () => {
  //   $refs.writeAdvice.writeAdvice = false;
};
const config = () => {
  //   axios
  //     .post("/advice/del", {
  //       id: adviceItem[currentDelIndex].id,
  //       username: $store.getters.user.username,
  //     })
  //     .then((res) => {
  //       console.log(res);
  //       if (res.data.error === -1) {
  //         Message.success("删除成功");
  //         getAllAdvice();
  //       } else {
  //         Message.error("删除失败");
  //       }
  //     });
};
const cancel = () => {
  //   showTip.value = false;
};
</script>

<style></style>
